home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / RADANGLE.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-29  |  4.6 KB  |  176 lines

  1. 10  'RADANGLE - Antenna radiation angle vs. height - 09 OCT 95 rev. 27 SEP 96
  2. 20  IF EX$=""THEN EX$="EXIT"
  3. 30  CLS:KEY OFF
  4. 40  COLOR 7,0,1
  5. 50  DIM A(20)
  6. 60  PI=3.14159
  7. 70  V=2.99793E+06*10^-4   'speed of light
  8. 80  UL$=STRING$(80,205)
  9. 90  U1$="###.###"
  10. 100  N=0    'reset counter
  11. 110  '
  12. 120  '.....start
  13. 130  CLS
  14. 140  COLOR 15,2
  15. 150  PRINT " RADIATION ANGLE - ANTENNAS";TAB(57);"by George Murphy VE3ERP ";
  16. 160  COLOR 1,0:PRINT STRING$(80,223);
  17. 170  COLOR 7,0
  18. 180  '
  19. 190  '.....standard antenna disclaimer
  20. 200  OPEN"I",1,"\data\docfiles\antenna.doc
  21. 210  IF EOF(1)THEN 230
  22. 220  INPUT#1,Z$:PRINT "   ";Z$:GOTO 210
  23. 230  CLOSE
  24. 240  PRINT UL$;
  25. 250  GOSUB 1250    'preface
  26. 260  Z$=INKEY$:IF Z$=""THEN 260
  27. 270  IF Z$="0"THEN CLS:RUN EX$
  28. 280  IF Z$="1"THEN 300
  29. 290  GOTO 260
  30. 300  VIEW PRINT CSRLIN-1 TO 24:CLS:VIEW PRINT
  31. 310  GOSUB 1630   'dump screen
  32. 320  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  33. 330  GOTO 400
  34. 340  '
  35. 350  '.....format input line
  36. 360  LOCATE CSRLIN-1:PRINT SPC(7);
  37. 370  LOCATE CSRLIN,47:PRINT STRING$(7,".");USING U1$;ZZ;
  38. 380  RETURN
  39. 390  '
  40. 400  '.....input data
  41. 410  PRINT " Press number in < > to enter antenna height in:
  42. 420  PRINT UL$;
  43. 430  PRINT "   <1> Wavelengths"
  44. 440  PRINT "   <2> Metres"
  45. 450  PRINT "   <3> Feet"
  46. 460  I$=INKEY$:IF I$=""THEN 460
  47. 470  IF I$="1"THEN L=1:GOTO 500
  48. 480  IF VAL(I$)>=1 AND VAL(I$)<=3 THEN 500
  49. 490  GOTO 460
  50. 500  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  51. 510  INPUT " ENTER: Resonant frequency of antenna...........(MHz)";F
  52. 520  ZZ=F:GOSUB 350:PRINT " MHz"
  53. 530  W=V/F
  54. 540  PRINT "        Wavelength...................................";USING U1$;W;
  55. 550  PRINT " metres"
  56. 560  '
  57. 570  IF I$="1"THEN H$="wavelengths"
  58. 580  IF I$="2"THEN H$="metres....."
  59. 590  IF I$="3"THEN H$="feet......."
  60. 600  PRINT " ENTER: Height of antenna in ";H$;".............";:INPUT HT
  61. 610  ZZ=HT:GOSUB 350:PRINT "        "
  62. 620  IF I$="1"THEN H=HT
  63. 630  IF I$="2"THEN H=HT/W
  64. 640  IF I$="3"THEN H=HT/W*0.3048
  65. 650  IF H=HT THEN 670
  66. 660  PRINT "        Height of antenna in wavelengths.............";USING U1$;H
  67. 670  IF H>=0.25 AND H<=5 THEN 900
  68. 680  BEEP:PRINT
  69. 690  IF H>=0.25 THEN 820
  70. 700  M=HT/H/4
  71. 710  IF I$="1"THEN M$="":PRINT
  72. 720  IF I$="2"THEN M$=" metres."
  73. 730  IF I$="3"THEN M$=" feet."
  74. 740  PRINT TAB(6);"1/4 wavelength =";USING U1$;M;:PRINT M$
  75. 750  PRINT
  76. 760  PRINT TAB(6);
  77. 770  PRINT "Antenna heights less than 1/4 wavelength cannot attain maximum"
  78. 780  PRINT TAB(6);
  79. 790  PRINT "ground reflection reinforcement to the direct ray from the antenna."
  80. 800  GOTO 870
  81. 810  '
  82. 820  PRINT:PRINT TAB(6);
  83. 830  PRINT "You have entered a height of more than five wavelengths, which is";
  84. 840  PRINT TAB(6);
  85. 850  PRINT "the arbitrary practical limit set by this program."
  86. 860  GOTO 870
  87. 870  PRINT:PRINT TAB(6);"Press any key to start over..........."
  88. 880  IF INKEY$=""THEN 880 ELSE CLS:GOTO 140
  89. 890  '
  90. 900  '.....compute results
  91. 910  IF H/0.25=INT(H/0.25)THEN H=H+9.8E-08
  92. 920  N=N+1
  93. 930  X=N/4/H
  94. 940  GOSUB 1180
  95. 950  IF DELTA=PI/2 THEN 990
  96. 960  A(N)=D
  97. 970  GOTO 920
  98. 980  '
  99. 990  '.....screen print
  100. 1000  PRINT UL$;
  101. 1010  PRINT TAB(7);
  102. 1020  PRINT "RADIATION ANGLES AT WHICH GROUND-REFLECTION MAXIMA and NULLS APPEAR"
  103. 1030  PRINT TAB(27);"MAXIMA";TAB(46);"NULLS"
  104. 1040  PRINT UL$;
  105. 1050  FOR Z=1 TO N STEP 2
  106. 1060  IF A(Z)<>0 THEN PRINT TAB(28);USING "##.#";A(Z);:PRINT "<UNK! {00F8}>";
  107. 1070  IF A(Z+1)<>0 THEN PRINT TAB(46);USING "##.#";A(Z+1);:PRINT "<UNK! {00F8}>";
  108. 1080  NEXT Z
  109. 1090  PRINT UL$;
  110. 1100  PRINT TAB(T);
  111. 1110  PRINT "Appreciable HF radiation at angles smaller than a few degrees is"
  112. 1120  PRINT TAB(T);
  113. 1130  PRINT "almost impossible to obtain over horizontal ground. However, above"
  114. 1140  PRINT TAB(T);
  115. 1150  PRINT "15<UNK! {00F8}> the above angles are accurate enough for practical purposes."
  116. 1160  GOTO 1580   'end
  117. 1170  '
  118. 1180  '.....compute arcsin of angle X
  119. 1190  Y=-X^2+1
  120. 1200  IF Y<=0 THEN DELTA=PI/2:GOTO 1220
  121. 1210  DELTA=ATN(X/SQR(Y))        'wave angle in radians
  122. 1220  D=DELTA*180/PI             'wave angle in degrees
  123. 1230  RETURN
  124. 1240  '
  125. 1250  '.....preface
  126. 1260  T=7
  127. 1270  PRINT TAB(T);
  128. 1280  PRINT "  This program computes the antenna wave angle versus height above"
  129. 1290  PRINT TAB(T);
  130. 1300  PRINT "the effective ground plane, which is seldom the actual surface of"
  131. 1310  PRINT TAB(T);
  132. 1320  PRINT "the ground. Instead, it is usually a few centimetres to perhaps a"
  133. 1330  PRINT TAB(T);
  134. 1340  PRINT "metre or so below it, depending on the characteristics of the soil."
  135. 1350  PRINT
  136. 1360  PRINT TAB(T);
  137. 1370  PRINT "  The calculations are valid for all horizontal antennas and for"
  138. 1380  PRINT TAB(T);
  139. 1390  PRINT "vertical antennas having a length equal to an even multiple of"
  140. 1400  PRINT TAB(T);
  141. 1410  PRINT "one-half wavelength. For vertical antennas an odd number of half-"
  142. 1420  PRINT TAB(T);
  143. 1430  PRINT "waves long, the maxima are the angles shown in the 'NULLS' column"
  144. 1440  PRINT TAB(T);
  145. 1450  PRINT "and the nulls are the angles shown in the 'MAXIMA' column."
  146. 1460  PRINT
  147. 1470  PRINT TAB(T);
  148. 1480  PRINT "  The program is based on data presented in the ARRL ELECTRONICS"
  149. 1490  PRINT TAB(T);
  150. 1500  PRINT "DATA BOOK, Second Edition, page 7-1, and the 1994 ARRL HANDBOOK,"
  151. 1510  PRINT TAB(T);
  152. 1520  PRINT "pages 17-2 and 17-3."
  153. 1530  COLOR 0,7:LOCATE 25,22
  154. 1540  PRINT " Press 1 to continue or 0 to EXIT.....";
  155. 1550  COLOR 7,0
  156. 1560  RETURN
  157. 1570  '
  158. 1580  '.....end
  159. 1590  GOSUB 1630
  160. 1600  GOTO 120
  161. 1610  END
  162. 1620  '
  163. 1630  'HARDCOPY
  164. 1640  GOSUB 1750:LOCATE 25,2:COLOR 14,6
  165. 1650  PRINT " Press 1 to print screen, 2 to print screen & ";
  166. 1660  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  167. 1670  Z$=INKEY$:IF Z$="3"THEN GOSUB 1750:RETURN
  168. 1680  IF Z$="1"OR Z$="2"THEN GOSUB 1750:GOTO 1700
  169. 1690  GOTO 1670
  170. 1700  FOR QX=1 TO 24:FOR QY=1 TO 80
  171. 1710  LPRINT CHR$(SCREEN(QX,QY));
  172. 1720  NEXT QY:NEXT QX
  173. 1730  IF Z$="2"THEN LPRINT CHR$(12)
  174. 1740  GOTO 1640
  175. 1750  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  176.